﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter02
{
    public class MoreBasicTypes : ICodeListing
    {
        public string BooleanType { get; set; }

        public string StringType { get; set; }

        public void CodeListing()
        {
            CompareString();
            EscapeChar();
            SmileyFaceChars();
            InsertNewLineChars();
            DispalyTriangleChars();
            PalindromeLength();
            UnalterableString();
            ProcessString();
            Console.ReadLine();
        }

        private void CompareString()
        {
            var option = "same of string option";
            int comparison = string.Compare(option, "/Help", true);
        }

        private void EscapeChar()
        {
            Console.WriteLine('\'');
        }

        private void SmileyFaceChars()
        {
            Console.Write('\u003a');
            Console.WriteLine('\u0029');
        }

        private void InsertNewLineChars()
        {
            Console.Write("\"Truly, you have a dizzying intellcet.\"");
            Console.WriteLine("\n\"wait 'til I get going!\"\n");
        }

        private void DispalyTriangleChars()
        {
            Console.WriteLine(
@"begin

end");
        }

        private void PalindromeLength()
        {
            Console.Write("Enter a palindrome: ");
            var palindrome = Console.ReadLine();
            Console.WriteLine("The palindrome, \"{0}\" is {1} characters.", palindrome, palindrome.Length);
        }

        private void UnalterableString()
        {
            Console.WriteLine("Enter text: ");
            var text = Console.ReadLine();
            //UNEXPECTED: Does not convert text to uppercase
            text.ToUpper();
            Console.WriteLine(text);
        }

        private void ProcessString()
        {
            Console.WriteLine("Enter text: ");
            var text = Console.ReadLine();
            text = text.ToUpper();
            Console.WriteLine(text);
        }
    }
}
